package com.winit.core.configuration;

import com.winit.common.util.Constants;
import com.winit.core.configuration.syncer.VCSFileSyncer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Created by wangjian on 16/8/4.
 * 定时更新config
 */
@Component
public class SyncerTracker {

    static  final  Logger logger = LoggerFactory.getLogger(SyncerTracker.class);

    @Scheduled(cron="0 */10 * * * ?")
    public void onSync(){
        logger.info("定时更新configuration");
        VCSFileSyncer vcsFileSyncer = new VCSFileSyncer(Constants.CONFIG_REPOSITORY_SVN);
        vcsFileSyncer.doSynce();
    }
}
